-
Notifications
You must be signed in to change notification settings - Fork 18
add test for fmod #301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add test for fmod #301
Conversation
test/Feature/HLSLLib/fmod.32.test
Outdated
- Name: ExpectedOut0 | ||
Format: Float32 | ||
Stride: 16 | ||
Data: [ 0.2, -0.990005, 0, 0.25, 0, 2.1154, 0.2, -0.990005, 0, 0.25, 0, 2.1154, 0.2, -0.98999, 0, 0.25 ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to remove the ...00005, since epsilon is sufficiently large
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also -0.98999 is strange, expected -.99
test/Feature/HLSLLib/fmod.16.test
Outdated
Format: Float16 | ||
Stride: 8 | ||
Data: [ 0x3800, 0xB780, 0x0, 0x3400, 0x0, 0x0, 0x3800, 0xB780, 0x0, 0x3400, 0x0, 0x0, 0x3800, 0xB800, 0x0, 0x3400 ] | ||
# 0.5, -0.46875, 0, 0.25, 0, 0, 0.5 -0.46875, 0, 0.25, 0, 0, 0.5, -0.46875, 0, 0.25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected 10.5 mod 1.1 to be 0.6, I'm surprised 0.5 is the answer? It also doesn't seem like epsilon is high enough to tolerate this error, I'm surprised this is passing.
Also shocked at how far off -99.5 mod -3 is from .5, should we add -Gis
to the compilation options perhaps to improve precision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the comment on the value was wrong, it was 1 not 1.1; Added Gis and have set the reuslt to -.5
test/Feature/HLSLLib/fmod.16.test
Outdated
|
||
Out0[0] = fmod(In0[0], In1[0]); | ||
Out0[1] = half4(fmod(In0[1].xyz, In1[1].xyz), fmod(In0[1].w, In1[1].w)); | ||
Out0[2] = half4(fmod(In0[2].xy, In1[2].xy), fmod(In0[2].zw, In1[2].zw)); | ||
Out0[3] = fmod(half4(10.5, -99.5, 5, 0.25), half4(1, -3, 0.25, 5)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
Out0[0] = fmod(In0[0], In1[0]); | |
Out0[1] = half4(fmod(In0[1].xyz, In1[1].xyz), fmod(In0[1].w, In1[1].w)); | |
Out0[2] = half4(fmod(In0[2].xy, In1[2].xy), fmod(In0[2].zw, In1[2].zw)); | |
Out0[3] = fmod(half4(10.5, -99.5, 5, 0.25), half4(1, -3, 0.25, 5)); | |
} | |
Out0[0] = fmod(In0[0], In1[0]); | |
Out0[1] = half4(fmod(In0[1].xyz, In1[1].xyz), fmod(In0[1].w, In1[1].w)); | |
Out0[2] = half4(fmod(In0[2].xy, In1[2].xy), fmod(In0[2].zw, In1[2].zw)); | |
Out0[3] = fmod(half4(10.5, -99.5, 5, 0.25), half4(1, -3, 0.25, 5)); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Add test for half and float versions of fmod.
closes #172